The World Wide Web (WWW) makes documents (i.e., Web pages) available to Internet users. These documents may contain text, graphical images, video images, audio sounds, and even executable programs. Moreover, these documents may contain links to other documents on the WWW. In order that Web documents may contain links to other Web documents, they are written in HTML.
A hierarchical HTML document comprises numerous nested components that together form a tree. Each nested component is identified by a starttag and a corresponding (or matching) endtag. The starttags and endtags form the branches of the tree. The contents between the starttags and endtags that are not starttags or endtags, such as text strings or single (or empty) tags, form the leaves of the tree.
Conventional HTML document editors represent an HTML document simply as trees in a data structure with starttag, endtag, and leaf items respectively corresponding to the starttags, endtags, and leaf contents of the HTML document. As a result, in editing the HTML document, these HTML document editors must traverse not only the starttag and endtag items of the HTML document, but also all of the elements of the leaf items. This unfortunately makes the editing process complex, cumbersome, and slow.